import request from '@/utils/request'
export function fetchBookList(params) {
  return request({
    url: '/data',
    method: 'GET',
    params
  })
}
export function fetchAddBook(data) {
  return request({
    url: '/data',
    method: 'POST',
    data
  })
}
// 详情
export function fetchBookDetail(id) {
  return request({
    url: `/data/${id}`,
    method: 'GET'
  })
}
//修改
export function fetchUpdateBook(data) {
  return request({
    url: `/data/${data.id}`,
    method: 'PUT',
    data
  })
}
// 删除
export function fetchDelBook(id) {
  return request({
    url: `/data/${id}`,
    method: 'DELETE'
  })
}
// 搜索
export function fetchSearchBook(value) {
  return request({
    url: `/data/?name=${value}`,
    method: 'GET'
  })
}
